package com.linkoog.devtools.intellij.ui.table;

import lombok.Getter;

import java.util.LinkedHashMap;

@Getter
public abstract class TableRowData {

    /**
     * Enable、Editable、Visible
     */
    private final LinkedHashMap<String, Object> options = new LinkedHashMap<>();

    public String getNameEnable(String name){
        return name + "Enable";
    }

    public String getNameEditable(String name){
        return name + "Editable";
    }

    public String getNameVisible(String name){
        return name + "Visible";
    }

    public void setEnable(String name,boolean enable){
        options.put(getNameEnable(name), enable);
    }

    public boolean getEnable(String name){
        Object val = options.get(getNameEnable(name));
        return Boolean.TRUE.equals(val);
    }

    public void setEditable(String name,boolean editable){
        options.put(getNameEditable(name), editable);
    }

    public boolean getEditable(String name){
        Object val = options.get(getNameEditable(name));
        return Boolean.TRUE.equals(val);
    }

    public void setVisible(String name,  boolean visible){
        options.put(getNameVisible(name), visible);
    }

    public boolean getVisible(String name){
        Object val = options.get(getNameVisible(name));
        return Boolean.TRUE.equals(val);
    }
}
